package com.martini.satoken01.config;

import com.martini.satoken01.service.MessageQueueService;
import com.martini.satoken01.service.RocketMessageQueueServiceImpl;
import org.apache.rocketmq.spring.core.RocketMQTemplate;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

/**
 * @author martini at 2021/12/23 16:00
 */
@SpringBootConfiguration
public class MessageQueueConfiguration {
    @Bean
    @ConditionalOnMissingBean
    public MessageQueueService messageQueueService(RocketMQTemplate rocketMQTemplate) {
        return new RocketMessageQueueServiceImpl(rocketMQTemplate);
    }
}
